using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using C4F.DevKit.Messaging;

namespace MapiApplication
{
    public partial class Main : Form
    { 
        #region Globals

        MailClient m = null;
        ProfileSettings ps = null;
        public static string profileName = "Outlook"; 

        #endregion

        #region Constructors

        public Main()
        {
            InitializeComponent();
        }

        #endregion

        #region EventHandlers
        private void btnSettings_Click(object sender, EventArgs e)
        {
            this.Hide();

            Cursor.Current = Cursors.WaitCursor;
            try
            {
                ps = new ProfileSettings();
                ps.ShowDialog();
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }

            Dispose();
        }

        private void btnOpen_Click(object sender, EventArgs e)
        {
            this.Hide();

            Cursor.Current = Cursors.WaitCursor;
            try
            {
                m = new MailClient(profileName);
                m.ShowDialog();
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }

            Dispose();
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        #endregion
    }
}